<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\SearchMessageModel */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>
<div class="message-model-index">


    <?php  echo $this->render('_search', ['model' => $searchModel]); ?>
    <p>
        <?php if (\backend\components\MenuHelper::checkRoute('create')){ echo Html::a('添加动态', ['create','hid'=>$searchModel->hid] , ['class' => 'btn btn-success']) ;  } ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            'title',
            'content',
            ['attribute' => 'create_at','value'=>function($model){return date('Y-m-d H:i:s',$model->create_at);}],

            [
                'class' => 'yii\grid\ActionColumn',
                'template' => \backend\components\MenuHelper::filterActionColumn('{update}&nbsp;&nbsp;{delete}')
            ],
        ],
    ]); ?>
</div>
